azure.ai.ml.operations package

class azure.ai.ml.operations.BatchDeploymentOperations(operation_scope: azure.ai.ml._scope_dependent_operations.OperationScope, service_client_05_2022: azure.ai.ml._restclient.v2022_05_01._azure_machine_learning_workspaces.AzureMachineLearningWorkspaces, service_client_09_2020_dataplanepreview: azure.ai.ml._restclient.v2020_09_01_dataplanepreview._azure_machine_learning_workspaces.AzureMachineLearningWorkspaces, all_operations: azure.ai.ml._scope_dependent_operations.OperationsContainer, local_endpoint_helper: azure.ai.ml.operations._local_endpoint_helper._LocalEndpointHelper, credentials: Optional[azure.identity._credentials.chained.ChainedTokenCredential] = None, **kwargs: Dict)[source]

You should not instantiate this class directly. Instead, you should create an MLClient instance that instantiates it for you and attaches it as an attribute.

begin_create_or_update(deployment: azure.ai.ml.entities._deployment.batch_deployment.BatchDeployment, **kwargs: Any)Union[azure.ai.ml.entities._deployment.batch_deployment.BatchDeployment, azure.core.polling._poller.LROPoller][source]

Create or update a batch deployment

Parameters

endpoint (BatchDeployment) – The deployment entity.

Returns

A poller to track the operation status.

Return type

LROPoller

begin_delete(name: str, endpoint_name: str, **kwargs: Any)Union[None, azure.core.polling._poller.LROPoller][source]

Delete a batch deployment.

Parameters

name (str) – Name of the batch endpoint.

Returns

A poller to track the operation status.

Return type

Optional[LROPoller]

get(name: str, endpoint_name: str)azure.ai.ml.entities._deployment.batch_deployment.BatchDeployment[source]

Get a deployment resource

Parameters
  • name (str) – The name of the deployment

  • endpoint_name (str) – The name of the endpoint

Returns

a deployment entity

Return type

BatchDeployment

list(endpoint_name: str)azure.core.paging.ItemPaged[azure.ai.ml.entities._deployment.batch_deployment.BatchDeployment][source]

List a deployment resource

Parameters

endpoint_name (str) – The name of the endpoint

Returns

an iterator of deployment entities

Return type

Iterable[BatchDeployment]

list_jobs(endpoint_name: str, name: str = None)[source]

List jobs under the provided batch endpoint deployment. This is only valid for batch endpoint.

Parameters
  • endpoint_name (str) – Name of endpoint.

  • name (str) – Name of deployment.

Raise

Exception if endpoint_type is not BATCH_ENDPOINT_TYPE

Returns

Iterable[BatchJobResourceArmPaginatedResult]

class azure.ai.ml.operations.BatchEndpointOperations(operation_scope: azure.ai.ml._scope_dependent_operations.OperationScope, service_client_05_2022: azure.ai.ml._restclient.v2022_05_01._azure_machine_learning_workspaces.AzureMachineLearningWorkspaces, service_client_09_2020_dataplanepreview: azure.ai.ml._restclient.v2020_09_01_dataplanepreview._azure_machine_learning_workspaces.AzureMachineLearningWorkspaces, all_operations: azure.ai.ml._scope_dependent_operations.OperationsContainer, credentials: Optional[azure.identity._credentials.chained.ChainedTokenCredential] = None, **kwargs: Dict)[source]

You should not instantiate this class directly. Instead, you should create an MLClient instance that instantiates it for you and attaches it as an attribute.

begin_create_or_update(endpoint: azure.ai.ml.entities._endpoint.batch_endpoint.BatchEndpoint, **kwargs: Any)Union[azure.ai.ml.entities._endpoint.batch_endpoint.BatchEndpoint, azure.core.polling._poller.LROPoller][source]

Create or update a batch endpoint

Parameters

endpoint (Endpoint) – The endpoint entity.

Returns

A poller to track the operation status.

Return type

LROPoller

begin_delete(name: str = None, **kwargs: Any)Union[None, azure.core.polling._poller.LROPoller][source]

Delete a batch Endpoint.

Parameters

name (str) – Name of the batch endpoint.

Returns

A poller to track the operation status.

Return type

Optional[LROPoller]

get(name: str)azure.ai.ml.entities._endpoint.batch_endpoint.BatchEndpoint[source]

Get a Endpoint resource.

Parameters

name (str) – Name of the endpoint.

Returns

Endpoint object retrieved from the service.

Return type

BatchEndpoint

invoke(endpoint_name: str, deployment_name: str = None, input: azure.ai.ml.entities._inputs_outputs.Input = None, params_override=None, **kwargs)azure.ai.ml._restclient.v2020_09_01_dataplanepreview.models._models_py3.BatchJobResource[source]

Invokes the batch endpoint with the provided payload

Parameters
  • endpoint_name (str) – the endpoint name

  • optional) deployment_name ((str,) – Name of a specific deployment to invoke. This is optional. By default requests are routed to any of the deployments according to the traffic rules.

  • optional) input ((Input,) – To use a existing data asset, public uri file, or folder pass in a Input object, for batch endpoints only.

  • optional) params_override ((List,) – Used to overwrite deployment configurations, for batch endpoints only.

Returns

Prediction output for online endpoints or details of batch prediction job.

Return type

Union[str, BatchJobResource]

list()Iterable[azure.ai.ml._restclient.v2022_05_01.models._models_py3.BatchEndpointTrackedResourceArmPaginatedResult][source]

List endpoints of the workspace.

Returns

a list of endpoints

list_jobs(endpoint_name: str)[source]

List jobs under the provided batch endpoint deployment. This is only valid for batch endpoint.

Parameters

endpoint_name (str) – the endpoint name

Returns

Iterable[BatchJobResourceArmPaginatedResult]

class azure.ai.ml.operations.ComponentOperations(operation_scope: azure.ai.ml._scope_dependent_operations.OperationScope, service_client: Union[azure.ai.ml._restclient.v2022_05_01._azure_machine_learning_workspaces.AzureMachineLearningWorkspaces, azure.ai.ml._restclient.v2021_10_01_dataplanepreview._azure_machine_learning_workspaces.AzureMachineLearningWorkspaces], all_operations: azure.ai.ml._scope_dependent_operations.OperationsContainer, **kwargs: Dict)[source]

You should not instantiate this class directly. Instead, you should create an MLClient instance that instantiates it for you and attaches it as an attribute.

archive(name: str, version: str = None, label: str = None)None[source]

Archive a component. :param name: Name of the component. :type name: str :param version: Version of the component. :type version: str :param label: Label of the component. (mutually exclusive with version) :type label: str

create_or_update(component: Union[azure.ai.ml.entities._component.component.Component, function], **kwargs)azure.ai.ml.entities._component.component.Component[source]

Create or update a specified component. if there’re inline defined entities, e.g. Environment, Code, they’ll be created together with the component.

Parameters

component (Union[Component, types.FunctionType]) – The component object or a mldesigner component function that generates component object

get(name: str, version: str = None, label: str = None)azure.ai.ml.entities._component.component.Component[source]

Returns information about the specified component.

Parameters
  • name (str) – Name of the code component.

  • version (str) – Version of the component.

  • label (str) – Label of the component. (mutually exclusive with version)

list(name: Optional[str] = None, *, list_view_type: azure.ai.ml._restclient.v2022_05_01.models._azure_machine_learning_workspaces_enums.ListViewType = <ListViewType.ACTIVE_ONLY: 'ActiveOnly'>)Iterable[Union[azure.ai.ml.entities._component.component.Component, azure.ai.ml._restclient.v2022_05_01.models._models_py3.ComponentContainerDetails]][source]

List specific component or components of the workspace.

Parameters
  • name (Optional[str]) – Component name, if not set, list all components of the workspace

  • list_view_type (Optional[ListViewType]) – View type for including/excluding (for example) archived components. Default: ACTIVE_ONLY.

Returns

An iterator like instance of component objects

Return type

ItemPaged[Component]

restore(name: str, version: str = None, label: str = None)None[source]

Restore an archived component. :param name: Name of the component. :type name: str :param version: Version of the component. :type version: str :param label: Label of the component. (mutually exclusive with version) :type label: str

validate(component: Union[azure.ai.ml.entities._component.component.Component, function], raise_on_failure: bool = False, **kwargs)azure.ai.ml.entities._validation.ValidationResult[source]

validate a specified component. if there are inline defined entities, e.g. Environment, Code, they won’t be created.

Parameters
  • component (Union[Component, types.FunctionType]) – The component object or a mldesigner component function that generates component object

  • raise_on_failure (bool) – whether to raise exception on validation error

Returns

All validation errors

Type

ValidationResult

class azure.ai.ml.operations.ComputeOperations(operation_scope: azure.ai.ml._scope_dependent_operations.OperationScope, service_client: azure.ai.ml._restclient.v2021_10_01._azure_machine_learning_workspaces.AzureMachineLearningWorkspaces, **kwargs: Dict)[source]

You should not instantiate this class directly. Instead, you should create an MLClient instance that instantiates it for you and attaches it as an attribute.

attach(compute: azure.ai.ml.entities._compute.compute.Compute, **kwargs: Any)azure.core.polling._poller.LROPoller[source]

Attaches a compute to the workspace.

Parameters

compute (Compute) – Compute definition.

Returns

A poller to track the operation status.

Return type

LROPoller

begin_create_or_update(compute: azure.ai.ml.entities._compute.compute.Compute, **kwargs: Any)azure.core.polling._poller.LROPoller[source]

Create a compute

Parameters

compute (Compute) – Compute definition.

Returns

A poller to track the operation status.

Return type

LROPoller

begin_delete(name: str, *, action: str = 'Delete', **kwargs: Any)azure.core.polling._poller.LROPoller[source]

Delete a compute

Parameters
  • name (str) – The name of the compute.

  • action (Optional[str]) – Action to perform. Possible values: [“Delete”, “Detach”]. Defaults to “Delete”.

Returns

A poller to track the operation status.

Return type

LROPoller

begin_restart(name: str, **kwargs: Any)azure.core.polling._poller.LROPoller[source]

Restart a compute

Parameters

name (str) – The name of the compute.

Returns

A poller to track the operation status.

Return type

LROPoller

begin_start(name: str, **kwargs: Any)azure.core.polling._poller.LROPoller[source]

Start a compute

Parameters

name (str) – The name of the compute.

Returns

A poller to track the operation status.

Return type

LROPoller

begin_stop(name: str, **kwargs: Any)azure.core.polling._poller.LROPoller[source]

Stop a compute.

Parameters

name (str) – The name of the compute.

Returns

A poller to track the operation status.

Return type

LROPoller

begin_update(compute: azure.ai.ml.entities._compute.compute.Compute, **kwargs: Any)azure.core.polling._poller.LROPoller[source]

Update a compute. Currently only valid for AmlCompute.

Parameters

compute (Compute) – Compute resource.

Returns

A poller to track the operation status.

Return type

LROPoller

get(name: str)azure.ai.ml.entities._compute.compute.Compute[source]

Get a compute resource

Parameters

name (str) – Name of the compute

Returns

Compute object

Return type

Compute

list(compute_type: str = None)Iterable[azure.ai.ml.entities._compute.compute.Compute][source]

List computes of the workspace

Parameters

compute_type (str) – the type of the compute to be listed, defaults to amlcompute

Returns

An iterator like instance of Compute objects

Return type

ItemPaged[Compute]

list_nodes(name: str)Iterable[azure.ai.ml.entities._compute._aml_compute_node_info.AmlComputeNodeInfo][source]

Get a compute resource nodes

Parameters

name (str) – Name of the compute

Returns

An iterator over aml compute node information objects

Return type

ItemPaged[AmlComputeNodeInfo]

list_sizes(*, location: str = None, compute_type: str = None)Iterable[azure.ai.ml.entities._compute._vm_size.VmSize][source]

Returns supported VM Sizes in a location.

Parameters

location (str) – The location upon which virtual-machine-sizes is queried. If location not provided, defaults to workspace location.

Returns

An iterator over virtual machine sizes.

Return type

Iterable[VmSize]

list_usage(*, location: str = None)Iterable[azure.ai.ml.entities._compute._usage.Usage][source]

Gets the current usage information as well as limits for AML resources for given subscription and location. :param location: The location for which resource usage is queried. If location not provided , defaults to workspace location :type location: str :return: An iterator over current usage info :rtype: ~azure.core.paging.ItemPaged[Usage]

class azure.ai.ml.operations.DataOperations(operation_scope: azure.ai.ml._scope_dependent_operations.OperationScope, service_client: azure.ai.ml._restclient.v2022_05_01._azure_machine_learning_workspaces.AzureMachineLearningWorkspaces, datastore_operations: azure.ai.ml.operations._datastore_operations.DatastoreOperations, **kwargs: Dict)[source]
archive(name: str, version: str = None, label: str = None)None[source]

Archive a data asset.

Parameters
  • name (str) – Name of data asset.

  • version (str) – Version of data asset.

  • label (str) – Label of the data asset. (mutually exclusive with version)

Returns

None

create_or_update(data: azure.ai.ml.entities._assets._artifacts.data.Data)azure.ai.ml.entities._assets._artifacts.data.Data[source]

Returns created or updated data asset.

If not already in storage, asset will be uploaded to the workspace’s blob storage.

Parameters

data (Data) – Data asset object.

Returns

Data asset object.

get(name: str, version: Optional[str] = None, label: Optional[str] = None)azure.ai.ml.entities._assets._artifacts.data.Data[source]

Get the specified data asset.

Parameters
  • name (str) – Name of data asset.

  • version (str) – Version of data asset.

  • label (str) – Label of the data asset. (mutually exclusive with version)

Returns

Data asset object.

list(name: Optional[str] = None, *, list_view_type: azure.ai.ml._restclient.v2022_02_01_preview.models._azure_machine_learning_workspaces_enums.ListViewType = <ListViewType.ACTIVE_ONLY: 'ActiveOnly'>)azure.core.paging.ItemPaged[azure.ai.ml.entities._assets._artifacts.data.Data][source]

List the data assets of the workspace.

Parameters
  • name (Optional[str]) – Name of a specific data asset, optional.

  • list_view_type (Optional[ListViewType]) – View type for including/excluding (for example) archived data assets. Default: ACTIVE_ONLY.

Returns

An iterator like instance of Data objects

Return type

ItemPaged[Data]

restore(name: str, version: str = None, label: str = None)None[source]

Restore an archived data asset.

Parameters
  • name (str) – Name of data asset.

  • version (str) – Version of data asset.

  • label (str) – Label of the data asset. (mutually exclusive with version)

Returns

None

class azure.ai.ml.operations.DatastoreOperations(operation_scope: azure.ai.ml._scope_dependent_operations.OperationScope, serviceclient_2022_05_01: azure.ai.ml._restclient.v2022_05_01._azure_machine_learning_workspaces.AzureMachineLearningWorkspaces, **kwargs: Dict)[source]

Represents a client for performing operations on Datastores

You should not instantiate this class directly. Instead, you should create MLClient and use this client via the property MLClient.datastores

create_or_update(datastore: azure.ai.ml.entities._datastore.datastore.Datastore)azure.ai.ml.entities._datastore.datastore.Datastore[source]

Attaches the passed in datastore to the workspace or updates the datastore if it already exists

Parameters

datastore (Datastore) – The configuration of the datastore to attach.

Returns

The attached datastore.

Return type

Datastore

delete(name: str)None[source]

Deletes a datastore reference with the given name from the workspace. This method does not delete the actual datastore or underlying data in the datastore.

Parameters

name (str) – Name of the datastore

get(name: str, *, include_secrets: bool = False)azure.ai.ml.entities._datastore.datastore.Datastore[source]

Returns information about the datastore referenced by the given name

Parameters
  • name (str) – Datastore name

  • include_secrets (bool, optional) – Include datastore secrets in the returned datastore, defaults to False

Returns

Datastore with the specified name.

Return type

Datastore

get_default(*, include_secrets: bool = False)azure.ai.ml.entities._datastore.datastore.Datastore[source]

Returns the workspace’s default datastore

Parameters

include_secrets (bool, optional) – Include datastore secrets in the returned datastore, defaults to False

Returns

The default datastore.

Return type

Datastore

list(*, include_secrets: bool = False)Iterable[azure.ai.ml.entities._datastore.datastore.Datastore][source]

Lists all datastores and associated information within a workspace

Parameters

include_secrets (bool, optional) – Include datastore secrets in returned datastores, defaults to False

Returns

An iterator like instance of Datastore objects

Return type

ItemPaged[Datastore]

class azure.ai.ml.operations.EnvironmentOperations(operation_scope: azure.ai.ml._scope_dependent_operations.OperationScope, service_client: Union[azure.ai.ml._restclient.v2022_05_01._azure_machine_learning_workspaces.AzureMachineLearningWorkspaces, azure.ai.ml._restclient.v2021_10_01_dataplanepreview._azure_machine_learning_workspaces.AzureMachineLearningWorkspaces], all_operations: azure.ai.ml._scope_dependent_operations.OperationsContainer, **kwargs: Any)[source]

You should not instantiate this class directly. Instead, you should create an MLClient instance that instantiates it for you and attaches it as an attribute.

archive(name: str, version: str = None, label: str = None)None[source]

Archive an environment or an environment version. :param name: Name of the environment. :type name: str :param version: Version of the environment. :type version: str :param label: Label of the environment. (mutually exclusive with version) :type label: str

create_or_update(environment: azure.ai.ml.entities._assets.environment.Environment)azure.ai.ml.entities._assets.environment.Environment[source]

Returns created or updated environment asset.

Parameters

environment (Environment) – Environment object

Returns

Created or updated Environment object

get(name: str, version: str = None, label: str = None)azure.ai.ml.entities._assets.environment.Environment[source]

Returns the specified environment asset.

Parameters
  • name (str) – Name of the environment.

  • version (str) – Version of the environment.

  • label (str) – Label of the environment. (mutually exclusive with version)

Returns

Environment object

list(name: str = None, *, list_view_type: azure.ai.ml._restclient.v2022_02_01_preview.models._azure_machine_learning_workspaces_enums.ListViewType = <ListViewType.ACTIVE_ONLY: 'ActiveOnly'>)Iterable[azure.ai.ml.entities._assets.environment.Environment][source]

List all environment assets in workspace.

Parameters
  • name (Optional[str]) – Name of the environment.

  • list_view_type (Optional[ListViewType]) – View type for including/excluding (for example) archived environments. Default: ACTIVE_ONLY.

Returns

An iterator like instance of Environment objects.

Return type

ItemPaged[Environment]

restore(name: str, version: str = None, label: str = None, **kwargs)None[source]

Restore an archived environment version. :param name: Name of the environment. :type name: str :param version: Version of the environment. :type version: str :param label: Label of the environment. (mutually exclusive with version) :type label: str

class azure.ai.ml.operations.JobOperations(operation_scope: azure.ai.ml._scope_dependent_operations.OperationScope, service_client_02_2022_preview: azure.ai.ml._restclient.v2022_02_01_preview._azure_machine_learning_workspaces.AzureMachineLearningWorkspaces, all_operations: azure.ai.ml._scope_dependent_operations.OperationsContainer, credential: azure.identity._credentials.chained.ChainedTokenCredential, **kwargs: Any)[source]

You should not instantiate this class directly. Instead, you should create an MLClient instance that instantiates it for you and attaches it as an attribute.

archive(name: str)None[source]

Archive a job or restore an archived job.

Parameters

name (str) – Name of the job.

Raise

ResourceNotFoundError if can’t find a job matching provided name.

cancel(name: str)None[source]

Cancel job resource.

Parameters

name (str) – Name of the job.

Returns

None, or the result of cls(response)

Return type

None

Raise

ResourceNotFoundError if can’t find a job matching provided name.

create_or_update(job: Union[azure.ai.ml.entities._job.job.Job, azure.ai.ml.entities._builders.base_node.BaseNode], *, description: str = None, compute: str = None, tags: dict = None, experiment_name: str = None, **kwargs)azure.ai.ml.entities._job.job.Job[source]

Create or update a job, if there’re inline defined entities, e.g. Environment, Code, they’ll be created together with the job.

Parameters
  • job (Union[Job,BaseNode]) – Job definition or object which can be translate to a job.

  • description (str) – Description to overwrite when submitting the pipeline.

  • compute (str) – Compute target to overwrite when submitting the pipeline.

  • tags (dict) – Tags to overwrite when submitting the pipeline.

  • experiment_name (str) – Name of the experiment the job will be created under, if None is provided, job will be created under experiment ‘Default’.

Returns

Created or updated job.

Return type

Job

download(name: str, *, download_path: Union[os.PathLike, str] = PosixPath('/mnt/vss/_work/1/s/sdk/ml/azure-ai-ml'), output_name: str = None, all: bool = False)None[source]

Download logs and output of a job.

Parameters
  • name (str) – Name of a job.

  • str] download_path (Union[PathLike,) – Local path as download destination, defaults to current working directory.

  • output_name (str) – Named output to download, defaults to None.

  • all (bool) – Whether to download logs and all named outputs, defaults to False.

get(name: str)azure.ai.ml.entities._job.job.Job[source]

Get a job resource.

Parameters

name (str) – Name of the job.

Returns

Job object retrieved from the service.

Return type

Job

Raise

ResourceNotFoundError if can’t find a job matching provided name.

list(parent_job_name: str = None, *, list_view_type: azure.ai.ml._restclient.v2022_02_01_preview.models._azure_machine_learning_workspaces_enums.ListViewType = <ListViewType.ACTIVE_ONLY: 'ActiveOnly'>, schedule_defined: bool = None, scheduled_job_name: str = None)Iterable[azure.ai.ml.entities._job.job.Job][source]

List jobs of the workspace.

Parameters
  • parent_job_name (Optional[str]) – When provided, returns children of named job.

  • list_view_type (Optional[ListViewType]) – View type for including/excluding (for example) archived jobs. Default: ACTIVE_ONLY.

  • schedule_defined (Optional[bool]) – When provided, only jobs that initially defined a schedule will be returned.

  • scheduled_job_name (Optional[str]) – Name of a job that initially defined a schedule. When provided, only jobs triggered by the schedule of the given job will be returned.

Returns

An iterator like instance of Job objects.

Return type

ItemPaged[Job]

restore(name: str)None[source]

Archive a job or restore an archived job.

Parameters

name (str) – Name of the job.

Raise

ResourceNotFoundError if can’t find a job matching provided name.

stream(name: str)None[source]

Stream logs of a job.

Parameters

name (str) – Name of the job.

Raise

ResourceNotFoundError if can’t find a job matching provided name.

try_get_compute_arm_id(compute: Union[azure.ai.ml.entities._compute.compute.Compute, str])[source]
class azure.ai.ml.operations.ModelOperations(operation_scope: azure.ai.ml._scope_dependent_operations.OperationScope, service_client: Union[azure.ai.ml._restclient.v2022_05_01._azure_machine_learning_workspaces.AzureMachineLearningWorkspaces, azure.ai.ml._restclient.v2021_10_01_dataplanepreview._azure_machine_learning_workspaces.AzureMachineLearningWorkspaces], datastore_operations: azure.ai.ml.operations._datastore_operations.DatastoreOperations, **kwargs: Dict)[source]

You should not instantiate this class directly. Instead, you should create an MLClient instance that instantiates it for you and attaches it as an attribute.

archive(name: str, version: str = None, label: str = None)None[source]

Archive a model asset.

Parameters
  • name (str) – Name of model asset.

  • version (str) – Version of model asset.

  • label (str) – Label of the model asset. (mutually exclusive with version)

create_or_update(model: azure.ai.ml.entities._assets._artifacts.model.Model)azure.ai.ml.entities._assets._artifacts.model.Model[source]
download(name: str, version: str, download_path: Union[os.PathLike, str] = '/mnt/vss/_work/1/s/sdk/ml/azure-ai-ml')None[source]

Download files related to a model.

Parameters
  • name (str) – Name of the model.

  • version (str) – Version of the model.

  • str] download_path (Union[PathLike,) – Local path as download destination, defaults to current working directory of the current user. Contents will be overwritten.

Raise

ResourceNotFoundError if can’t find a model matching provided name.

get(name: str, version: str = None, label: str = None)azure.ai.ml.entities._assets._artifacts.model.Model[source]

Returns information about the specified model asset.

Parameters
  • name (str) – Name of the model.

  • version (str) – Version of the model.

  • label (str) – Label of the model. (mutually exclusive with version)

list(name: str = None, *, list_view_type: azure.ai.ml._restclient.v2022_02_01_preview.models._azure_machine_learning_workspaces_enums.ListViewType = <ListViewType.ACTIVE_ONLY: 'ActiveOnly'>)Iterable[azure.ai.ml.entities._assets._artifacts.model.Model][source]

List all model assets in workspace.

Parameters
  • name (Optional[str]) – Name of the model.

  • list_view_type (Optional[ListViewType]) – View type for including/excluding (for example) archived models. Default: ACTIVE_ONLY.

Returns

An iterator like instance of Model objects

Return type

ItemPaged[Model]

restore(name: str, version: str = None, label: str = None)None[source]

Restore an archived model asset.

Parameters
  • name (str) – Name of model asset.

  • version (str) – Version of model asset.

  • label (str) – Label of the model asset. (mutually exclusive with version)

class azure.ai.ml.operations.OnlineDeploymentOperations(operation_scope: azure.ai.ml._scope_dependent_operations.OperationScope, service_client_02_2022_preview: azure.ai.ml._restclient.v2022_02_01_preview._azure_machine_learning_workspaces.AzureMachineLearningWorkspaces, all_operations: azure.ai.ml._scope_dependent_operations.OperationsContainer, local_deployment_helper: azure.ai.ml.operations._local_deployment_helper._LocalDeploymentHelper, credentials: Optional[azure.identity._credentials.chained.ChainedTokenCredential] = None, **kwargs: Dict)[source]

You should not instantiate this class directly. Instead, you should create an MLClient instance that instantiates it for you and attaches it as an attribute.

begin_create_or_update(deployment: azure.ai.ml.entities._deployment.online_deployment.OnlineDeployment, *, local: bool = False, vscode_debug: bool = False, no_wait: bool = False)None[source]

Create or update a deployment

Parameters
  • deployment (OnlineDeployment) – the deployment entity

  • local (bool, optional) – Whether deployment should be created locally, defaults to False

  • vscode_debug (bool, optional) – Whether to open VSCode instance to debug local deployment, defaults to False

  • no_wait (bool, optional) – Applied only to online deployment, defaults to False

Returns

None

Return type

None | OnlineDeployment

delete(name: str, endpoint_name: str, local: bool = False)None[source]

Delete a deployment

Parameters
  • name (str) – The name of the deployment

  • endpoint_name (str) – The name of the endpoint

  • local (bool, optional) – Whether deployment should be retrieved from local docker environment, defaults to False

get(name: str, endpoint_name: str, local: bool = False)azure.ai.ml.entities._deployment.online_deployment.OnlineDeployment[source]

Get a deployment resource

Parameters
  • name (str) – The name of the deployment

  • endpoint_name (str) – The name of the endpoint

  • local (bool, optional) – Whether deployment should be retrieved from local docker environment, defaults to False

Returns

a deployment entity

Return type

OnlineDeployment

get_logs(name: str, endpoint_name: str, lines: int, container_type: Optional[str] = None, local: bool = False)str[source]

Retrive the logs from online deployment.

Parameters
  • name (str) – The name of the deployment

  • endpoint_name (str) – The name of the endpoint

  • lines (int) – The maximum number of lines to tail

  • container_type (Optional[str], optional) – The type of container to retrieve logs from. Possible values include: “StorageInitializer”, “InferenceServer”, defaults to None

  • local (bool, optional) – [description], defaults to False

Returns

the logs

Return type

str

list(endpoint_name: str, local: bool = False)azure.core.paging.ItemPaged[azure.ai.ml.entities._deployment.online_deployment.OnlineDeployment][source]

List a deployment resource

Parameters
  • endpoint_name (str) – The name of the endpoint

  • local (bool, optional) – Whether deployment should be retrieved from local docker environment, defaults to False

Returns

an iterator of deployment entities

Return type

Iterable[OnlineDeployment]

class azure.ai.ml.operations.OnlineEndpointOperations(operation_scope: azure.ai.ml._scope_dependent_operations.OperationScope, service_client_02_2022_preview: azure.ai.ml._restclient.v2022_02_01_preview._azure_machine_learning_workspaces.AzureMachineLearningWorkspaces, all_operations: azure.ai.ml._scope_dependent_operations.OperationsContainer, local_endpoint_helper: azure.ai.ml.operations._local_endpoint_helper._LocalEndpointHelper, credentials: Optional[azure.identity._credentials.chained.ChainedTokenCredential] = None, **kwargs: Dict)[source]

You should not instantiate this class directly. Instead, you should create an MLClient instance that instantiates it for you and attaches it as an attribute.

begin_create_or_update(endpoint: azure.ai.ml.entities._endpoint.online_endpoint.OnlineEndpoint, local: bool = False, **kwargs: Any)azure.core.polling._poller.LROPoller[source]

Create or update an endpoint

Parameters
  • endpoint (Endpoint) – The endpoint entity.

  • local (bool) – Whether to interact with the endpoint in local Docker environment. Defaults to False.

Returns

A poller to track the operation status if remote, else returns None if local.

Return type

LROPoller

begin_delete(name: str = None, local: bool = False, **kwargs: Any)azure.core.polling._poller.LROPoller[source]

Delete an Online Endpoint.

Parameters
  • name (str) – Name of the endpoint.

  • local (bool) – Whether to interact with the endpoint in local Docker environment. Defaults to False.

Returns

A poller to track the operation status if remote, else returns None if local.

Return type

Optional[LROPoller]

begin_regenerate_keys(name: str, key_type: str = 'primary', **kwargs: Any)azure.core.polling._poller.LROPoller[source]

Regenerate keys for endpoint

Parameters
  • name (The endpoint type. Defaults to ONLINE_ENDPOINT_TYPE.) – The endpoint name.

  • key_type (str) – One of “primary”, “secondary”. Defaults to “primary”.

Returns

A poller to track the operation status.

Return type

LROPoller

get(name: str, local: bool = False)azure.ai.ml.entities._endpoint.online_endpoint.OnlineEndpoint[source]

Get a Endpoint resource.

Parameters
  • name (str) – Name of the endpoint.

  • optional) local ((bool,) – a flag to indicate whether to interact with endpoints in local Docker environment. Default: False.

Returns

Endpoint object retrieved from the service.

Return type

OnlineEndpoint:

invoke(endpoint_name: str, request_file: str = None, deployment_name: str = None, input_data: Union[str, azure.ai.ml.entities._assets._artifacts.data.Data] = None, params_override=None, local: bool = False, **kwargs)str[source]

Invokes the endpoint with the provided payload

Parameters
  • endpoint_name (str) – the endpoint name

  • optional) request_file ((str,) – File containing the request payload. This is only valid for online endpoint.

  • optional) deployment_name ((str,) – Name of a specific deployment to invoke. This is optional. By default requests are routed to any of the deployments according to the traffic rules.

  • Data], optional) input_data ((Union[str,) – To use a pre-registered data asset, pass str in format

  • optional) local ((bool,) – a flag to indicate whether to interact with endpoints in local Docker environment. Default: False.

Returns

Prediction output for online endpoint.

Return type

str

list(local: bool = False)Iterable[azure.ai.ml._restclient.v2022_02_01_preview.models._models_py3.OnlineEndpointTrackedResourceArmPaginatedResult][source]

List endpoints of the workspace.

Parameters

optional) local ((bool,) – a flag to indicate whether to interact with endpoints in local Docker environment. Default: False.

Returns

a list of endpoints

list_keys(name: str)Union[azure.ai.ml._restclient.v2022_02_01_preview.models._models_py3.EndpointAuthKeys, azure.ai.ml._restclient.v2022_02_01_preview.models._models_py3.EndpointAuthToken][source]

List the keys

Parameters

str (name) – the endpoint name

Raise

Exception if cannot get online credentials

Return Union[EndpointAuthKeys, EndpointAuthToken]

depending on the auth mode in the endpoint, returns either keys or token

class azure.ai.ml.operations.WorkspaceConnectionsOperations(operation_scope: azure.ai.ml._scope_dependent_operations.OperationScope, service_client: azure.ai.ml._restclient.v2022_01_01_preview._azure_machine_learning_workspaces.AzureMachineLearningWorkspaces, all_operations: azure.ai.ml._scope_dependent_operations.OperationsContainer, credentials: Optional[azure.identity._credentials.chained.ChainedTokenCredential] = None, **kwargs: Dict)[source]

You should not instantiate this class directly. Instead, you should create an MLClient instance that instantiates it for you and attaches it as an attribute.

create_or_update(workspace_connection, **kwargs)azure.ai.ml.entities._workspace.connections.workspace_connection.WorkspaceConnection[source]

Create or update a workspace connection.

Parameters

workspace_connection (WorkspaceConnection) – Workspace Connection definition or object which can be translated to a workspace connection.

Returns

Created or update workspace connection.

Return type

WorkspaceConnection

delete(name)None[source]

Delete the workspace connection

Parameters

name (str) – Name of the workspace connection.

get(name: str, **kwargs: Dict)azure.ai.ml.entities._workspace.connections.workspace_connection.WorkspaceConnection[source]

Get a workspace connection by name.

Parameters

name (str) – Name of the workspace connection.

Returns

The workspace connection with the provided name.

Return type

WorkspaceConnection

list(connection_type=None, **kwargs)Iterable[azure.ai.ml.entities._workspace.connections.workspace_connection.WorkspaceConnection][source]

List all environment assets in workspace.

Parameters

connection_type (str) – Type of workspace connection to list.

Returns

An iterator like instance of workspace connection objects

Return type

Iterable[WorkspaceConnection]

class azure.ai.ml.operations.WorkspaceOperations(operation_scope: azure.ai.ml._scope_dependent_operations.OperationScope, service_client: azure.ai.ml._restclient.v2022_01_01_preview._azure_machine_learning_workspaces.AzureMachineLearningWorkspaces, all_operations: azure.ai.ml._scope_dependent_operations.OperationsContainer, credentials: Optional[azure.identity._credentials.chained.ChainedTokenCredential] = None, **kwargs: Dict)[source]

You should not instantiate this class directly. Instead, you should create an MLClient instance that instantiates it for you and attaches it as an attribute.

begin_create(workspace: azure.ai.ml.entities._workspace.workspace.Workspace, update_dependent_resources: bool = False, **kwargs: Dict)azure.core.polling._poller.LROPoller[source]

Create a new Azure Machine Learning Workspace.

Returns the workspace if already exists.

Parameters

workspace (Workspace) – Workspace definition.

Returns

A poller to track the operation status.

Return type

LROPoller

begin_delete(name: str, *, delete_dependent_resources: bool, **kwargs: Dict)azure.core.polling._poller.LROPoller[source]

Delete a workspace

Parameters
  • name (str) – Name of the workspace

  • delete_dependent_resources (bool) – Whether to delete resources associated with the workspace, i.e., container registry, storage account, key vault, and application insights. The default is False. Set to True to delete these resources.

Returns

A poller to track the operation status.

Return type

LROPoller

begin_diagnose(name: str, **kwargs: Dict)azure.core.polling._poller.LROPoller[source]

Diagnose workspace setup problems

If your workspace is not working as expected, you can run this diagnosis to check if the workspace has been broken. For private endpoint workspace, it will also help check out if the network setup to this workspace and its dependent resource has problem or not.

Parameters

name (str) – Name of the workspace

Returns

A poller to track the operation status.

Return type

LROPoller

begin_sync_keys(name: str = None, **kwargs: Dict)azure.core.polling._poller.LROPoller[source]

Triggers the workspace to immediately synchronize keys. If keys for any resource in the workspace are changed, it can take around an hour for them to automatically be updated. This function enables keys to be updated upon request. An example scenario is needing immediate access to storage after regenerating storage keys.

Parameters

name (str) – Name of the workspace.

begin_update(workspace: azure.ai.ml.entities._workspace.workspace.Workspace, *, update_dependent_resources: bool = False, **kwargs: Dict)Union[azure.core.polling._poller.LROPoller, azure.ai.ml.entities._workspace.workspace.Workspace][source]

Update friendly name, description or tags of a workspace.

Parameters
  • workspace (Workspace) – Workspace resource.

  • update_dependent_resources – gives your consent to update the workspace dependent resources. Note that updating the workspace-attached Azure Container Registry resource may break lineage of previous jobs or your ability to rerun earlier jobs in this workspace. Also, updating the workspace-attached Azure Application Insights resource may break lineage of deployed inference endpoints this workspace. Only set this argument if you are sure that you want to perform this operation. If this argument is not set, the command to update Azure Container Registry and Azure Application Insights will fail.

  • application_insights – Application insights resource for workspace.

  • container_registry – Container registry resource for workspace.

Returns

A poller to track the operation status.

Return type

LROPoller

get(name: str = None, **kwargs: Dict)azure.ai.ml.entities._workspace.workspace.Workspace[source]

Get a workspace by name.

Parameters

name (str) – Name of the workspace.

Returns

The workspace with the provided name.

Return type

Workspace

list(*, scope: str = 'resource_group')Iterable[azure.ai.ml.entities._workspace.workspace.Workspace][source]

List all workspaces that the user has access to in the current resource group or subscription

Parameters

scope (str, optional) – scope of the listing, “resource_group” or “subscription”, defaults to “resource_group”

Returns

An iterator like instance of Workspace objects

Return type

ItemPaged[Workspace]

list_keys(name: str = None)azure.ai.ml._restclient.v2022_01_01_preview.models._models_py3.ListWorkspaceKeysResult[source]

List keys for the workspace.

Parameters

name (str) – Name of the workspace.

Returns

A list of keys.

Return type

ListWorkspaceKeysResult