ai_api_client_sdk.resource_clients.deployment_client module

class ai_api_client_sdk.resource_clients.deployment_client.DeploymentClient(rest_client: RestClient)

Bases: BaseClient

DeploymentClient is a class implemented for interacting with the deployment related endpoints of the server. It implements the base class ai_api_client_sdk.resource_clients.base_client.BaseClient

create(configuration_id: str, ttl: str = None, resource_group: str = None) DeploymentCreateResponse

Creates a deployment.

Parameters:
  • configuration_id (str) – ID of the configuration, that should configure the deployment

  • ttl – Time to live for deployment and can be none or take a number followed by the unit

(any of following values, minutes(m|M), hours(h|H) or days(d|D)) :type ttl: str, optional :param resource_group: Resource Group which the request should be sent on behalf. Either this or a default

resource group in the ai_api_client_sdk.ai_api_v2_client.AIAPIV2Client should be specified, defaults to None

Raises:

class:ai_api_client_sdk.exception.AIAPIInvalidRequestException if a 400 response is received from the server

Raises:

class:ai_api_client_sdk.exception.AIAPIAuthorizationException if a 401 response is received from the server

Raises:

class:ai_api_client_sdk.exception.AIAPIServerException if a non-2XX response is received from the server

Returns:

An object representing the response from the server

Return type:

class:ai_api_client_sdk.models.deployment_create_response.DeploymentCreateResponse

delete(deployment_id: str, resource_group: str = None) BasicResponse

Deletes the deployment.

Parameters:
  • deployment_id (str) – ID of the deployment to be deleted

  • resource_group (str) – Resource Group which the request should be sent on behalf. Either this or a default resource group in the ai_api_client_sdk.ai_api_v2_client.AIAPIV2Client should be specified, defaults to None

Raises:

class:ai_api_client_sdk.exception.AIAPIInvalidRequestException if a 400 response is received from the server

Raises:

class:ai_api_client_sdk.exception.AIAPIAuthorizationException if a 401 response is received from the server

Raises:

class:ai_api_client_sdk.exception.AIAPINotFoundException if a 404 response is received from the server

Raises:

class:ai_api_client_sdk.exception.AIAPIPreconditionFailedException if a 412 response is received from the server

Raises:

class:ai_api_client_sdk.exception.AIAPIServerException if a non-2XX response is received from the server

Returns:

An object representing the response from the server

Return type:

class:ai_api_client_sdk.models.base_models.BasicResponse

get(deployment_id: str, resource_group: str = None, select: str = None) Deployment | DeploymentGetStatusResponse

Retrieves the deployment from the server.

Parameters:
  • deployment_id (str) – ID of the deployment to be retrieved

  • resource_group (str) – Resource Group which the request should be sent on behalf. Either this or a default resource group in the ai_api_client_sdk.ai_api_v2_client.AIAPIV2Client should be specified, defaults to None

  • select (str, optional) – only status supported. Get deployment for a given deployment id and select status

Raises:

class:ai_api_client_sdk.exception.AIAPIInvalidRequestException if a 400 response is received from the server

Raises:

class:ai_api_client_sdk.exception.AIAPIAuthorizationException if a 401 response is received from the server

Raises:

class:ai_api_client_sdk.exception.AIAPINotFoundException if a 404 response is received from the server

Raises:

class:ai_api_client_sdk.exception.AIAPIServerException if a non-2XX response is received from the server

Returns:

The retrieved deployment

Return type:

class:Union[ai_api_client_sdk.models.deployment.Deployment, ai_api_client_sdk.models.deployment_get_status_response.DeploymentGetStatusResponse]

modify(deployment_id: str, target_status: TargetStatus = None, configuration_id: str = None, resource_group: str = None) BasicResponse

Modifies the deployment, by changing either the target status, or the configuration ID.

Parameters:
  • deployment_id (str) – ID of the deployment to be modified

  • target_status (class:ai_api_client_sdk.models.target_status.TargetStatus, optional) – Desired target status of the deployment, defaults to None

  • configuration_id (str, optional) – ID of the new configuration to be used by the deployment, defaults to None

  • resource_group (str) – Resource Group which the request should be sent on behalf. Either this or a default resource group in the ai_api_client_sdk.ai_api_v2_client.AIAPIV2Client should be specified, defaults to None

Raises:

class:ai_api_client_sdk.exception.AIAPIInvalidRequestException if a 400 response is received from the server

Raises:

class:ai_api_client_sdk.exception.AIAPIAuthorizationException if a 401 response is received from the server

Raises:

class:ai_api_client_sdk.exception.AIAPINotFoundException if a 404 response is received from the server

Raises:

class:ai_api_client_sdk.exception.AIAPIPreconditionFailedException if a 412 response is received from the server

Returns:

An object representing the response from the server

Return type:

class:ai_api_client_sdk.models.base_models.BasicResponse

query(scenario_id: str = None, configuration_id: str = None, executable_ids: List[str] = None, status: Status = None, top: int = None, skip: int = None, resource_group: str = None) DeploymentQueryResponse

Queries the deployments.

Parameters:
  • scenario_id (str, optional) – ID of the scenario the deployments should belong to, defaults to None

  • configuration_id (str, optional) – ID of the configuration, the deployments should be configured by, defaults to None

  • executable_ids (List[str], optional) – IDs of the executables the deployments should be created from, defaults to None

  • status (class:ai_api_client_sdk.models.status.Status, optional) – Status which the deployments should currently have

  • top (int, optional) – Number of deployments to be retrieved, defaults to None

  • skip (int, optional) – Number of deployments to be skipped, from the list of the queried deployments, defaults to None

  • resource_group (str) – Resource Group which the request should be sent on behalf. Either this or a default resource group in the ai_api_client_sdk.ai_api_v2_client.AIAPIV2Client should be specified, defaults to None

Raises:

class:ai_api_client_sdk.exception.AIAPIInvalidRequestException if a 400 response is received from the server

Raises:

class:ai_api_client_sdk.exception.AIAPIAuthorizationException if a 401 response is received from the server

Raises:

class:ai_api_client_sdk.exception.AIAPIServerException if a non-2XX response is received from the server

Returns:

An object representing the response from the server

Return type:

class:ai_api_client_sdk.models.deployment_query_response.DeploymentQueryResponse

count(scenario_id: str = None, configuration_id: str = None, executable_ids: List[str] = None, status: Status = None, resource_group: str = None) int

Counts the number of deployments.

Parameters:
  • scenario_id (str, optional) – ID of the scenario, the deployments should belong to, defaults to None

  • configuration_id (str, optional) – ID of the configuration, the deployments should be configured by, defaults to None

  • executable_ids (List[str], optional) – IDs of the executables, the deployments should be created from, defaults to None

  • status (class:ai_api_client_sdk.models.status.Status, optional) – Status which the deployments should currently have

  • resource_group (str) – Resource group which the request should be sent on behalf. Either this or a default resource group in the ai_api_client_sdk.ai_api_v2_client.AIAPIV2Client should be specified, defaults to None

Raises:

class:ai_api_client_sdk.exception.AIAPIInvalidRequestException if a 400 response is received from the server

Raises:

class:ai_api_client_sdk.exception.AIAPIAuthorizationException if a 401 response is received from the server

Raises:

class:ai_api_client_sdk.exception.AIAPIServerException if a non-2XX response is received from the server

Returns:

An object representing the response from the server

Return type:

int

query_logs(deployment_id: str, top: int = None, start: datetime = None, end: datetime = None, order: Order = None, resource_group: str = None) LogResponse

Queries the logs of the deployment.

Parameters:
  • deployment_id (str) – ID of the deployment

  • top (int) – The max number of entries to return. Defaults to 1000. Limited to 5000 max.

  • start (datetime) – The start time for the query. Defaults to one hour ago.

  • end (datetime) – The end time for the query. Defaults to now.

  • order (class:ai_api_client_sdk.models.base_models.Order) – Determines the sort order with respect to time. Defaults to asc.

  • resource_group (str) – Resource Group which the request should be sent on behalf. Either this or a default resource group in the ai_api_client_sdk.ai_api_v2_client.AIAPIV2Client should be specified, defaults to None

Raises:

class:ai_api_client_sdk.exception.AIAPIInvalidRequestException if a 400 response is received from the server

Raises:

class:ai_api_client_sdk.exception.AIAPIAuthorizationException if a 401 response is received from the server

Raises:

class:ai_api_client_sdk.exception.AIAPINotFoundException if a 404 response is received from the server

Raises:

class:ai_api_client_sdk.exception.AIAPIServerException if a non-2XX response is received from the server

Returns:

Logs from the execution

Return type:

class:ai_api_client_sdk.models.log_response.LogResponse

bulk_modify(deployments: List[BasicModifyRequest], resource_group: str = None) DeploymentBulkModifyResponse

Modifies the deployments :param deployments: List of deployment modify requests :type deployments: List[DeploymentModifyRequest] :param resource_group: Resource Group which the request should be sent on behalf. Either this or a default

resource group in the ai_api_client_sdk.ai_api_v2_client.AIAPIV2Client should be specified, defaults to None

Raises:

class:ai_api_client_sdk.exception.AIAPIInvalidRequestException if a 400 response is received from the server

Raises:

class:ai_api_client_sdk.exception.AIAPIAuthorizationException if a 401 response is received from the server

Raises:

class:ai_api_client_sdk.exception.AIAPINotFoundException if a 404 response is received from the server

Raises:

class:ai_api_client_sdk.exception.AIAPIPreconditionFailedException if a 412 response is received from the server

Returns:

An object representing the response from the server

Return type:

class:ai_api_client_sdk.models.deployment_bulk_modify_response.DeploymentBulkModifyResponse