你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

BatchDeploymentOperations 类

BatchDeploymentOperations。

不应直接实例化此类。 相反,应创建一个 MLClient 实例来实例化它,并将其作为属性附加。

继承
azure.ai.ml._scope_dependent_operations._ScopeDependentOperations
BatchDeploymentOperations

构造函数

BatchDeploymentOperations(operation_scope: OperationScope, operation_config: OperationConfig, service_client_05_2022: AzureMachineLearningWorkspaces, all_operations: OperationsContainer, credentials: TokenCredential | None = None, **kwargs: Dict)

参数

operation_scope
<xref:azure.ai.ml._scope_dependent_operations.OperationScope>
必需

MLClient 对象的操作类的范围变量。

operation_config
<xref:azure.ai.ml._scope_dependent_operations.OperationConfig>
必需

MLClient 对象的操作类的常见配置。

service_client_05_2022
<xref:<xref:azure.ai.ml._restclient.v2022_05_01._azure_machine_learning_workspaces. AzureMachineLearningWorkspaces>>
必需

服务客户端,允许最终用户对 Azure 机器学习工作区资源进行操作。

all_operations
<xref:azure.ai.ml._scope_dependent_operations.OperationsContainer>
必需

MLClient 对象的所有操作类。

credentials
TokenCredential
默认值: None

用于身份验证的凭据。

方法

begin_create_or_update

创建或更新批处理部署。

begin_delete

删除批处理部署。

get

获取部署资源。

list

列出部署资源。

list_jobs

列出提供的批处理终结点部署下的作业。 这仅适用于批处理终结点。

begin_create_or_update

创建或更新批处理部署。

begin_create_or_update(deployment: DeploymentType, *, skip_script_validation: bool = False, **kwargs) -> LROPoller[DeploymentType]

参数

deployment
BatchDeployment
必需

部署实体。

返回

用于跟踪操作状态的轮询程序。

返回类型

例外

如果无法成功验证 BatchDeployment,则引发。 错误消息中将提供详细信息。

如果无法成功验证 BatchDeployment 资产 (,例如数据、代码、模型、环境) ,则引发。 错误消息中将提供详细信息。

如果无法成功验证 BatchDeployment 模型,则引发。 错误消息中将提供详细信息。

示例

创建示例。


   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

删除批处理部署。

begin_delete(name: str, endpoint_name: str) -> LROPoller[None]

参数

name
str
必需

批处理部署的名称。

endpoint_name
str
必需

批处理终结点的名称

返回

用于跟踪操作状态的轮询程序。

返回类型

例外

如果无法成功验证 BatchDeployment,则引发。 错误消息中将提供详细信息。

如果无法成功验证 BatchDeployment 资产 (,例如数据、代码、模型、环境) ,则引发。 错误消息中将提供详细信息。

如果无法成功验证 BatchDeployment 模型,则引发。 错误消息中将提供详细信息。

示例

删除示例。


   ml_client.batch_deployments.begin_delete(deployment_name, endpoint_name)

get

获取部署资源。

get(name: str, endpoint_name: str) -> BatchDeployment

参数

name
str
必需

部署的名称

endpoint_name
str
必需

终结点的名称

返回

部署实体

返回类型

例外

如果无法成功验证 BatchDeployment,则引发。 错误消息中将提供详细信息。

如果无法成功验证 BatchDeployment 资产 (,例如数据、代码、模型、环境) ,则引发。 错误消息中将提供详细信息。

如果无法成功验证 BatchDeployment 模型,则引发。 错误消息中将提供详细信息。

示例

获取示例。


   ml_client.batch_deployments.get(deployment_name, endpoint_name)

list

列出部署资源。

list(endpoint_name: str) -> ItemPaged[BatchDeployment]

参数

endpoint_name
str
必需

终结点的名称

返回

部署实体的迭代器

返回类型

例外

如果无法成功验证 BatchDeployment,则引发。 错误消息中将提供详细信息。

如果无法成功验证 BatchDeployment 资产 (,例如数据、代码、模型、环境) ,则引发。 错误消息中将提供详细信息。

如果无法成功验证 BatchDeployment 模型,则引发。 错误消息中将提供详细信息。

示例

列出部署资源示例。


   ml_client.batch_deployments.list(endpoint_name)

list_jobs

列出提供的批处理终结点部署下的作业。 这仅适用于批处理终结点。

list_jobs(endpoint_name: str, *, name: str | None = None) -> ItemPaged[BatchJob]

参数

endpoint_name
str
必需

终结点的名称。

name
str

(部署的可选) 名称。

返回

作业列表

返回类型

例外

如果无法成功验证 BatchDeployment,则引发。 错误消息中将提供详细信息。

如果无法成功验证 BatchDeployment 资产 (,例如数据、代码、模型、环境) ,则引发。 错误消息中将提供详细信息。

如果无法成功验证 BatchDeployment 模型,则引发。 错误消息中将提供详细信息。

示例

列出作业示例。


   ml_client.batch_deployments.list_jobs(deployment_name, endpoint_name)