GPR Template Binding APIs
This topic describes how to use the Python SDK to manage GPR template bindings including creation, listing, retrieval, updating, and deletion.
Create a GPR Template Binding
Use this API to create a new GPR template binding.
Syntax
egs.create_gpr_template_binding(workspace_name, clusters(clusterName, defaultTemplateName, templates), enable_auto_gpr, authenticated_session=none)
Parameters
| Parameter | Parameter Type | Description | Required |
|---|---|---|---|
| workspaceName | String | The name of the workspace. | Mandatory |
| clusters | Object | This object is an array of clusters. | Mandatory |
| enableAutoGPR | Boolean | This parameter denotes weather Auto GPR is enable or not. | Mandatory |
| authenticated_session | [AuthenticatedSession] | The authenticated session with the EGS Controller. The default value is None. If no authenticated session is provided, SDK tries to use the SDK default. If no SDK default is found, an exception is raised. | Optional |
Clusters Parameters
| Parameter | Parameter Type | Description | Required |
|---|---|---|---|
| clusterName | String | The name of the cluster. | Mandatory |
| defaultTemplateName | String | The default GPR template name. | Mandatory |
| templates | ListofStrings | The list of the GPR templates. | Mandatory |
Exceptions Raised
| Raises | Description |
|---|---|
| exceptions.Unhandled | This exception is raised when the API had no appropriate handling exceptions. |
Example
import egs
from egs.gpr_template_binding import create_gpr_template_binding
create_gpr_template_binding(
workspace_name="example-slice",
clusters=[
{
"clusterName": "cluster-1",
"defaultTemplateName": "template-a",
"templates": ["template-a", "template-b"]
}
],
enable_auto_gpr=True
)
Get a GPR Template Binding
Use this API to get the details of GPR template binding.
Syntax
egs.get_gpr_template_binding(binding-name, authenticated_session=None)
Parameters
| Parameter | Parameter Type | Description | Required |
|---|---|---|---|
| binding-name | String | The name of the GPR template binding. | Mandatory |
| authenticated_session | [AuthenticatedSession] | The authenticated session with the EGS Controller. The default value is None. If no authenticated session is provided, SDK tries to use the SDK default. If no SDK default is found, an exception is raised. | Optional |
Response Returned
| Returns | Description |
|---|---|
| Class GetGprTemplateBindingResponse | This object contains the list of GPR template bindings. |
GetGprTemplateBindingResponse
| Parameter | Type | Description |
|---|---|---|
| name | String | The name of the GPR template binding. |
| clusters | Object | This object contains the GPR template binding cluster status. |
| enable_auto_gpr | Boolean | This parameter denotes weather Auto GPR is enable or not. |
GetGprTemplateBindingClusterStatus
| Parameter | Type | Description |
|---|---|---|
| cluster_name | String | The name of the cluster. |
| default_template_name | String | The default GPR template name. |
| templates | ListofStrings | A list of GPR templates used by this cluster. |
| default_template_status | String | The status of the default template. |
| template_status | DictionaryofStrings | The status of each template (name → reason/status). |
Exceptions Raised
| Raises | Description |
|---|---|
| exceptions.Unhandled | This exception is raised when the API had no appropriate handling exceptions. |
Example
import egs
from egs.gpr_template_binding import get_gpr_template_binding
get_gpr_template_binding("binding-name")
List GPR Template Bindings
Use this API to get the list of template bindings associated with workspace.
Syntax
egs.list_gpr_template_bindings()
Response Returned
| Returns | Description |
|---|---|
| List of GprTemplateBindingResponse objects | The object that contains all the GPR template bindings is returned. |
ListGprTemplateBindingResponse
| Parameter | Type | Description |
|---|---|---|
| template_bindings | String | The name of the template binding. |
Exceptions Raised
| Raises | Description |
|---|---|
| exceptions.Unhandled | This exception is raised when the API had no appropriate handling exceptions. |
Example
import egs
from egs.gpr_template_binding import list_gpr_template_bindings
list_gpr_template_bindings()
Update a GPR Template Binding
Use this API to update the GPR template binding.
Syntax
egs.update_gpr_template_binding(workspace_name, clusters(clusterName, defaultTemplateName, templates),enable_auto_gpr, authenticated_session=none)
Parameters
| Parameter | Parameter Type | Description | Required |
|---|---|---|---|
| workspaceName | String | The name of the workspace. | Mandatory |
| clusters | Object | This object is an array of clusters. | Mandatory |
| enableAutoGPR | Boolean | This is the parameter to enable Auto GPR. | Mandatory |
| authenticated_session | [AuthenticatedSession] | The authenticated session with the EGS Controller. The default value is None. If no authenticated session is provided, SDK tries to use the SDK default. If no SDK default is found, an exception is raised. | Optional |
Clusters Parameters
| Parameter | Parameter Type | Description | Required |
|---|---|---|---|
| clusterName | String | The name of the cluster. | Mandatory |
| defaultTemplateName | String | The default GPR template name. | Mandatory |
| templates | ListofStrings | The list of the GPR templates. | Mandatory |
Response Returned
| Returns | Description |
|---|---|
| Void | There is no response object. |
Exceptions Raised
| Raises | Description |
|---|---|
| exceptions.Unhandled | This exception is raised when the API had no appropriate handling exceptions. |
Example
import egs
from egs.gpr_template_binding import update_gpr_template_binding
update_gpr_template_binding(
workspace_name="example-slice",
clusters=[
{
"clusterName": "cluster-1",
"defaultTemplateName": "template-a",
"templates": ["template-a", "template-c"]
}
],
enable_auto_gpr=False
)
Delete the GPR Template Binding
Use this API to delete the GPR template binding associated with the workspace.
Syntax
egs.delete_gpr_template_binding(binding-name,authenticated_session=None)
Parameters
| Parameter | Parameter Type | Description | Required |
|---|---|---|---|
| binding-name | String | The name of the GPR template binding. | Mandatory |
| authenticated_session | [AuthenticatedSession] | The authenticated session with the EGS Controller. The default value is None. If no authenticated session is provided, SDK tries to use the SDK default. If no SDK default is found, an exception is raised. | Optional |
Response Returned
| Returns | Description |
|---|---|
| Void | There is no response object. |
Exceptions Raised
| Raises | Description |
|---|---|
| exceptions.Unhandled | This exception is raised when the API had no appropriate handling exceptions. |
Example
import egs
from egs.gpr_template_binding import delete_gpr_template_binding
delete_gpr_template_binding("binding-name")