EnvironmentOperations Class

EnvironmentOperations.

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.

Inheritance
azure.ai.ml._scope_dependent_operations._ScopeDependentOperations
EnvironmentOperations

Constructor

EnvironmentOperations(operation_scope: azure.ai.ml._scope_dependent_operations.OperationScope, operation_config: azure.ai.ml._scope_dependent_operations.OperationConfig, 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)

Parameters

operation_scope
operation_config
service_client
all_operations

Methods

archive

Archive an environment or an environment version.

create_or_update

Returns created or updated environment asset.

get

Returns the specified environment asset.

list

List all environment assets in workspace.

restore

Restore an archived environment version.

archive

Archive an environment or an environment version.

archive(name: str, version: str = None, label: str = None) -> None

Parameters

name
str
Required

Name of the environment.

version
str
Required

Version of the environment.

label
str
Required

Label of the environment. (mutually exclusive with version)

create_or_update

Returns created or updated environment asset.

create_or_update(environment: azure.ai.ml.entities._assets.environment.Environment) -> azure.ai.ml.entities._assets.environment.Environment

Parameters

environment
Environment
Required

Environment object

Returns

Created or updated Environment object

Return type

Exceptions

Raised if Environment cannot be successfully validated. Details will be provided in the error message.

Raised if local path provided points to an empty directory.

get

Returns the specified environment asset.

get(name: str, version: str = None, label: str = None) -> azure.ai.ml.entities._assets.environment.Environment

Parameters

name
str
Required

Name of the environment.

version
str
Required

Version of the environment.

label
str
Required

Label of the environment. (mutually exclusive with version)

Returns

Environment object

Return type

Exceptions

Raised if Environment cannot be successfully validated. Details will be provided in the error message.

list

List all environment assets in workspace.

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]

Parameters

name
<xref:Optional>[str]
Required

Name of the environment.

list_view_type
<xref:Optional>[<xref:ListViewType>]
Required

View type for including/excluding (for example) archived environments. Default: ACTIVE_ONLY.

Returns

An iterator like instance of Environment objects.

Return type

restore

Restore an archived environment version.

restore(name: str, version: str = None, label: str = None) -> None

Parameters

name
str
Required

Name of the environment.

version
str
Required

Version of the environment.

label
str
Required

Label of the environment. (mutually exclusive with version)