ai_api_client_sdk.resource_clients.execution_client module¶
- class ai_api_client_sdk.resource_clients.execution_client.ExecutionClient(rest_client: RestClient)¶
Bases:
BaseClientExecutionClient is a class implemented for interacting with the execution related endpoints of the server. It implements the base class
ai_api_client_sdk.resource_clients.base_client.BaseClient- create(configuration_id: str, resource_group: str = None) ExecutionCreateResponse¶
Creates an execution.
- Parameters:
configuration_id (str) – ID of the configuration, that should configure the execution
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.AIAPIV2Clientshould 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.execution_create_response.ExecutionCreateResponse
- delete(execution_id: str, resource_group: str = None) BasicResponse¶
Deletes the execution.
- Parameters:
execution_id (str) – ID of the execution 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.AIAPIV2Clientshould 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(execution_id: str, resource_group: str = None, select: str = None) Execution | ExecutionGetStatusResponse¶
Retrieves the execution from the server.
- Parameters:
execution_id (str) – ID of the execution 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.AIAPIV2Clientshould be specified, defaults to Noneselect (str, optional) – only status supported. Get execution for a given execution 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 execution
- Return type:
class:Union[ai_api_client_sdk.models.execution.Execution, ai_api_client_sdk.models.execution_get_status_response.ExecutionGetStatusResponse]
- modify(execution_id: str, target_status: TargetStatus, resource_group: str = None) BasicResponse¶
Modifies the execution, by changing the target status.
- Parameters:
execution_id (str) – ID of the execution to be modified
target_status (class:ai_api_client_sdk.models.target_status.TargetStatus, optional) – Desired target status of the execution, 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.AIAPIV2Clientshould 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
- query(scenario_id: str = None, configuration_id: str = None, executable_ids: List[str] = None, execution_schedule_id: str = None, status: Status = None, top: int = None, skip: int = None, resource_group: str = None) ExecutionQueryResponse¶
Queries the executions.
- Parameters:
scenario_id (str, optional) – ID of the scenario the executions should belong to, defaults to None
configuration_id (str, optional) – ID of the configuration, the executions should be configured by, defaults to None
executable_ids (List[str], optional) – IDs of the executables the executions should be created from, defaults to None
execution_schedule_id (str, optional) – ID of the execution schedule, defaults to None
status (class:ai_api_client_sdk.models.status.Status, optional) – Status which the executions should currently have
top (int, optional) – Number of executions to be retrieved, defaults to None
skip (int, optional) – Number of executions to be skipped, from the list of the queried executions, 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.AIAPIV2Clientshould 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.execution_query_response.ExecutionQueryResponse
- count(scenario_id: str = None, configuration_id: str = None, executable_ids: List[str] = None, execution_schedule_id: str = None, status: Status = None, resource_group: str = None) int¶
Counts the number of executions.
- Parameters:
scenario_id (str, optional) – ID of the scenario, the executions should belong to, defaults to None
configuration_id (str, optional) – ID of the configuration, the executions should be configured by, defaults to None
executable_ids (List[str], optional) – IDs of the executables, the executions should be created from, defaults to None
execution_schedule_id (str, optional) – ID of the execution schedule, defaults to None
status (class:ai_api_client_sdk.models.status.Status, optional) – Status which the executions 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.AIAPIV2Clientshould 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(execution_id: str, top: int = None, start: datetime = None, end: datetime = None, order: Order = None, resource_group: str = None) LogResponse¶
Queries the logs of the execution.
- Parameters:
execution_id (str) – ID of the execution
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.AIAPIV2Clientshould 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(executions: List[BasicModifyRequest], resource_group: str = None) ExecutionBulkModifyResponse¶
Modifies the executions :param executions: List of execution modify requests :type executions: List[ExecutionModifyRequest] :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.AIAPIV2Clientshould 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.execution_bulk_modify_response.ExecutionBulkModifyResponse