ai_api_client_sdk.resource_clients.artifact_client module

class ai_api_client_sdk.resource_clients.artifact_client.ArtifactClient(rest_client: RestClient)

Bases: BaseClient

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

create(name: str, kind: Kind, url: str, scenario_id: str, description: str = None, labels: List[Label] = None, resource_group: str = None) ArtifactCreateResponse

Creates an artifact.

Parameters:
  • name (str) – Name of the artifact

  • kind (class:ai_api_client_sdk.models.artifact.Artifact.Kind) – Kind of the artifact

  • url (str) – URL of the artifact

  • scenario_id (str) – ID of the scenario which the artifact should belong to

  • description (str, optional) – Description of the artifact, defaults to None

  • labels (List[class:ai_api_client_sdk.models.label.Label]) – List of the labels of the artifact, 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.artifact_create_response.ArtifactCreateResponse

get(artifact_id: str, expand: str = None, resource_group: str = None) Artifact

Retrieves the artifact from the server.

Parameters:
  • artifact_id (str) – ID of the artifact to be retrieved

  • expand (str, optional) – Entity whose details to be displayed in the response, 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.AIAPIServerException if a non-2XX response is received from the server

Returns:

The retrieved artifact

Return type:

class:ai_api_client_sdk.models.artifact.Artifact

query(scenario_id: str = None, execution_id: str = None, name: str = None, kind: Kind = None, artifact_label_selector: List[str] = None, top: int = None, skip: int = None, search: str = None, search_case_insensitive: bool = None, expand: str = None, resource_group: str = None) ArtifactQueryResponse

Queries the artifacts.

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

  • execution_id (str, optional) – ID of the execution the artifact should be resulted from, defaults to None

  • name (str, optional) – Name of the artifact(s) to be retrieved, defaults to None

  • kind (class:ai_api_client_sdk.models.artifact.Artifact.Kind, optional) – Kind of the artifacts to be retrieved, defaults to None

  • artifact_label_selector (list, optional) – Query the artifacts based on their labels in the form of “key=value” or “key!=value” separated by commas, defaults to None

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

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

  • search (str, optional) – Generic search term to be looked for in various attributes of artifacts, defaults to None

  • search_case_insensitive (bool, optional) – Indicates whether the search should be case insensitive

  • expand (str, optional) – Entity whose details to be displayed in the response, 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.artifact_query_response.ArtifactQueryResponse

count(scenario_id: str = None, execution_id: str = None, name: str = None, kind: Kind = None, artifact_label_selector: List[str] = None, resource_group: str = None) int

Counts the artifacts.

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

  • execution_id (str, optional) – ID of the execution the artifact should be resulted from, defaults to None

  • name (str, optional) – Name of the artifact(s) to be retrieved, defaults to None

  • kind (class:ai_api_client_sdk.models.artifact.Artifact.Kind, optional) – Kind of the artifacts to be retrieved, defaults to None

  • artifact_label_selector (List[str], optional) – list of the label selector strings in the form of “key=value” or “key!=value”, to filter the artifacts with respect to their labels, 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:

int