BatchDeploymentOperations Class
BatchDeploymentOperations.
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._ScopeDependentOperationsBatchDeploymentOperations
Constructor
BatchDeploymentOperations(operation_scope: OperationScope, operation_config: OperationConfig, service_client_01_2024_preview: AzureMachineLearningWorkspaces, all_operations: OperationsContainer, credentials: TokenCredential | None = None, **kwargs: Any)
Parameters
Name | Description |
---|---|
operation_scope
Required
|
<xref:azure.ai.ml._scope_dependent_operations.OperationScope>
Scope variables for the operations classes of an MLClient object. |
operation_config
Required
|
<xref:azure.ai.ml._scope_dependent_operations.OperationConfig>
Common configuration for operations classes of an MLClient object. |
service_client_05_2022
Required
|
<xref:<xref:azure.ai.ml._restclient.v2022_05_01._azure_machine_learning_workspaces. AzureMachineLearningWorkspaces>>
Service client to allow end users to operate on Azure Machine Learning Workspace resources. |
all_operations
Required
|
<xref:azure.ai.ml._scope_dependent_operations.OperationsContainer>
All operations classes of an MLClient object. |
credentials
|
Credential to use for authentication. Default value: None
|
service_client_01_2024_preview
Required
|
|
Methods
begin_create_or_update |
Create or update a batch deployment. |
begin_delete |
Delete a batch deployment. |
get |
Get a deployment resource. |
list |
List a deployment resource. |
list_jobs |
List jobs under the provided batch endpoint deployment. This is only valid for batch endpoint. |
begin_create_or_update
Create or update a batch deployment.
begin_create_or_update(deployment: DeploymentType, *, skip_script_validation: bool = False, **kwargs: Any) -> LROPoller[DeploymentType]
Parameters
Name | Description |
---|---|
deployment
Required
|
The deployment entity. |
Keyword-Only Parameters
Name | Description |
---|---|
skip_script_validation
|
If set to True, the script validation will be skipped. Defaults to False. |
Returns
Type | Description |
---|---|
A poller to track the operation status. |
Exceptions
Type | Description |
---|---|
Raised if BatchDeployment cannot be successfully validated. Details will be provided in the error message. |
|
Raised if BatchDeployment assets (e.g. Data, Code, Model, Environment) cannot be successfully validated. Details will be provided in the error message. |
|
Raised if BatchDeployment model cannot be successfully validated. Details will be provided in the error message. |
Examples
Create example.
from azure.ai.ml import load_batch_deployment
from azure.ai.ml.entities import BatchDeployment
deployment_example = load_batch_deployment(
source="./sdk/ml/azure-ai-ml/tests/test_configs/deployments/batch/batch_deployment_anon_env_with_image.yaml",
params_override=[{"name": f"deployment-{randint(0, 1000)}", "endpoint_name": endpoint_example.name}],
)
ml_client.batch_deployments.begin_create_or_update(deployment=deployment_example, skip_script_validation=True)
begin_delete
Delete a batch deployment.
begin_delete(name: str, endpoint_name: str) -> LROPoller[None]
Parameters
Name | Description |
---|---|
name
Required
|
Name of the batch deployment. |
endpoint_name
Required
|
Name of the batch endpoint |
Keyword-Only Parameters
Name | Description |
---|---|
skip_script_validation
|
If set to True, the script validation will be skipped. Defaults to False. |
Returns
Type | Description |
---|---|
A poller to track the operation status. |
Exceptions
Type | Description |
---|---|
Raised if BatchDeployment cannot be successfully validated. Details will be provided in the error message. |
|
Raised if BatchDeployment assets (e.g. Data, Code, Model, Environment) cannot be successfully validated. Details will be provided in the error message. |
|
Raised if BatchDeployment model cannot be successfully validated. Details will be provided in the error message. |
Examples
Delete example.
ml_client.batch_deployments.begin_delete(deployment_name, endpoint_name)
get
Get a deployment resource.
get(name: str, endpoint_name: str) -> BatchDeployment
Parameters
Name | Description |
---|---|
name
Required
|
The name of the deployment |
endpoint_name
Required
|
The name of the endpoint |
Keyword-Only Parameters
Name | Description |
---|---|
skip_script_validation
|
If set to True, the script validation will be skipped. Defaults to False. |
Returns
Type | Description |
---|---|
A deployment entity |
Exceptions
Type | Description |
---|---|
Raised if BatchDeployment cannot be successfully validated. Details will be provided in the error message. |
|
Raised if BatchDeployment assets (e.g. Data, Code, Model, Environment) cannot be successfully validated. Details will be provided in the error message. |
|
Raised if BatchDeployment model cannot be successfully validated. Details will be provided in the error message. |
Examples
Get example.
ml_client.batch_deployments.get(deployment_name, endpoint_name)
list
List a deployment resource.
list(endpoint_name: str) -> ItemPaged[BatchDeployment]
Parameters
Name | Description |
---|---|
endpoint_name
Required
|
The name of the endpoint |
Keyword-Only Parameters
Name | Description |
---|---|
skip_script_validation
|
If set to True, the script validation will be skipped. Defaults to False. |
Returns
Type | Description |
---|---|
An iterator of deployment entities |
Exceptions
Type | Description |
---|---|
Raised if BatchDeployment cannot be successfully validated. Details will be provided in the error message. |
|
Raised if BatchDeployment assets (e.g. Data, Code, Model, Environment) cannot be successfully validated. Details will be provided in the error message. |
|
Raised if BatchDeployment model cannot be successfully validated. Details will be provided in the error message. |
Examples
List deployment resource example.
ml_client.batch_deployments.list(endpoint_name)
list_jobs
List jobs under the provided batch endpoint deployment. This is only valid for batch endpoint.
list_jobs(endpoint_name: str, *, name: str | None = None) -> ItemPaged[BatchJob]
Parameters
Name | Description |
---|---|
endpoint_name
Required
|
Name of endpoint. |
Keyword-Only Parameters
Name | Description |
---|---|
name
|
(Optional) Name of deployment. |
Returns
Type | Description |
---|---|
List of jobs |
Exceptions
Type | Description |
---|---|
Raised if BatchDeployment cannot be successfully validated. Details will be provided in the error message. |
|
Raised if BatchDeployment assets (e.g. Data, Code, Model, Environment) cannot be successfully validated. Details will be provided in the error message. |
|
Raised if BatchDeployment model cannot be successfully validated. Details will be provided in the error message. |
Examples
List jobs example.
ml_client.batch_deployments.list_jobs(deployment_name, endpoint_name)
Azure SDK for Python