BatchEndpointOperations Class

BatchEndpointOperations.

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
BatchEndpointOperations

Constructor

BatchEndpointOperations(operation_scope: OperationScope, operation_config: OperationConfig, service_client_10_2023: AzureMachineLearningServices, 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_10_2023
Required
<xref:<xref:azure.ai.ml._restclient.v2023_10_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

Methods

begin_create_or_update

Create or update a batch endpoint.

begin_delete

Delete a batch Endpoint.

get

Get a Endpoint resource.

invoke

Invokes the batch endpoint with the provided payload.

list

List endpoints of the workspace.

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 endpoint.

begin_create_or_update(endpoint: BatchEndpoint) -> LROPoller[BatchEndpoint]

Parameters

Name Description
endpoint
Required

The endpoint entity.

Returns

Type Description

A poller to track the operation status.

Examples

Create endpoint example.


   from azure.ai.ml.entities import BatchEndpoint

   endpoint_example = BatchEndpoint(name=endpoint_name_2)
   ml_client.batch_endpoints.begin_create_or_update(endpoint_example)

begin_delete

Delete a batch Endpoint.

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

Parameters

Name Description
name
Required
str

Name of the batch endpoint.

Returns

Type Description

A poller to track the operation status.

Examples

Delete endpoint example.


   ml_client.batch_endpoints.begin_delete(endpoint_name)

get

Get a Endpoint resource.

get(name: str) -> BatchEndpoint

Parameters

Name Description
name
Required
str

Name of the endpoint.

Returns

Type Description

Endpoint object retrieved from the service.

Examples

Get endpoint example.


   ml_client.batch_endpoints.get(endpoint_name)

invoke

Invokes the batch endpoint with the provided payload.

invoke(endpoint_name: str, *, deployment_name: str | None = None, inputs: Dict[str, Input] | None = None, **kwargs: Any) -> BatchJob

Parameters

Name Description
endpoint_name
Required
str

The endpoint name.

Keyword-Only Parameters

Name Description
deployment_name
str

(Optional) The 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.

inputs

(Optional) A dictionary of existing data asset, public uri file or folder to use with the deployment

Returns

Type Description

The invoked batch deployment job.

Exceptions

Type Description

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

Raised if BatchEndpoint assets (e.g. Data, Code, Model, Environment) cannot be successfully validated. Details will be provided in the error message.

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

Raised if local path provided points to an empty directory.

Examples

Invoke endpoint example.


   ml_client.batch_endpoints.invoke(endpoint_name_2)

list

List endpoints of the workspace.

list() -> ItemPaged[BatchEndpoint]

Returns

Type Description

A list of endpoints

Examples

List example.


   ml_client.batch_endpoints.list()

list_jobs

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

list_jobs(endpoint_name: str) -> ItemPaged[BatchJob]

Parameters

Name Description
endpoint_name
Required
str

The endpoint name

Returns

Type Description

List of jobs

Examples

List jobs example.


   ml_client.batch_endpoints.list_jobs(endpoint_name_2)