Skip to main content
Version: 1.14.0

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

ParameterParameter TypeDescriptionRequired
workspaceNameStringThe name of the workspace.Mandatory
clustersObjectThis object is an array of clusters.Mandatory
enableAutoGPRBooleanThis 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

ParameterParameter TypeDescriptionRequired
clusterNameStringThe name of the cluster.Mandatory
defaultTemplateNameStringThe default GPR template name.Mandatory
templatesListofStringsThe list of the GPR templates.Mandatory

Exceptions Raised

RaisesDescription
exceptions.UnhandledThis 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

ParameterParameter TypeDescriptionRequired
binding-nameStringThe 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

ReturnsDescription
Class GetGprTemplateBindingResponseThis object contains the list of GPR template bindings.

GetGprTemplateBindingResponse

ParameterTypeDescription
nameStringThe name of the GPR template binding.
clustersObjectThis object contains the GPR template binding cluster status.
enable_auto_gprBooleanThis parameter denotes weather Auto GPR is enable or not.

GetGprTemplateBindingClusterStatus

ParameterTypeDescription
cluster_nameStringThe name of the cluster.
default_template_nameStringThe default GPR template name.
templatesListofStringsA list of GPR templates used by this cluster.
default_template_statusStringThe status of the default template.
template_statusDictionaryofStringsThe status of each template (name → reason/status).

Exceptions Raised

RaisesDescription
exceptions.UnhandledThis 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

ReturnsDescription
List of GprTemplateBindingResponse objectsThe object that contains all the GPR template bindings is returned.

ListGprTemplateBindingResponse

ParameterTypeDescription
template_bindingsStringThe name of the template binding.

Exceptions Raised

RaisesDescription
exceptions.UnhandledThis 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

ParameterParameter TypeDescriptionRequired
workspaceNameStringThe name of the workspace.Mandatory
clustersObjectThis object is an array of clusters.Mandatory
enableAutoGPRBooleanThis 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

ParameterParameter TypeDescriptionRequired
clusterNameStringThe name of the cluster.Mandatory
defaultTemplateNameStringThe default GPR template name.Mandatory
templatesListofStringsThe list of the GPR templates.Mandatory

Response Returned

ReturnsDescription
VoidThere is no response object.

Exceptions Raised

RaisesDescription
exceptions.UnhandledThis 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

ParameterParameter TypeDescriptionRequired
binding-nameStringThe 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

ReturnsDescription
VoidThere is no response object.

Exceptions Raised

RaisesDescription
exceptions.UnhandledThis 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")