OnlineEndpointOperations Class

OnlineEndpointOperations.

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
OnlineEndpointOperations

Constructor

OnlineEndpointOperations(operation_scope: OperationScope, operation_config: OperationConfig, service_client_02_2022_preview: AzureMachineLearningWorkspaces, all_operations: OperationsContainer, local_endpoint_helper: _LocalEndpointHelper, credentials: TokenCredential | None = None, **kwargs: Dict)

Parameters

Name Description
operation_scope
Required
operation_config
Required
service_client_02_2022_preview
Required
all_operations
Required
local_endpoint_helper
Required
credentials
default value: None

Methods

begin_create_or_update

Create or update an endpoint.

begin_delete

Delete an Online Endpoint.

begin_regenerate_keys

Regenerate keys for endpoint.

get

Get a Endpoint resource.

get_keys

Get the auth credentials.

invoke

Invokes the endpoint with the provided payload.

list

List endpoints of the workspace.

begin_create_or_update

Create or update an endpoint.

begin_create_or_update(endpoint: OnlineEndpoint, *, local: bool = False) -> LROPoller[OnlineEndpoint]

Parameters

Name Description
endpoint
Required

The endpoint entity.

Keyword-Only Parameters

Name Description
local

Whether to interact with the endpoint in local Docker environment. Defaults to False.

Returns

Type Description

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

Exceptions

Type Description

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

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

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

Raised if local path provided points to an empty directory.

Raised if local endpoint resource does not exist.

begin_delete

Delete an Online Endpoint.

begin_delete(name: str | None = None, *, local: bool = False) -> LROPoller[None]

Parameters

Name Description
name
Required
str

Name of the endpoint.

Keyword-Only Parameters

Name Description
local

Whether to interact with the endpoint in local Docker environment. Defaults to False.

Returns

Type Description

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

Exceptions

Type Description

Raised if local endpoint resource does not exist.

begin_regenerate_keys

Regenerate keys for endpoint.

begin_regenerate_keys(name: str, *, key_type: str = 'primary') -> LROPoller[None]

Parameters

Name Description
name
Required
<xref:<xref:The endpoint type. Defaults to ONLINE_ENDPOINT_TYPE.>>

The endpoint name.

Keyword-Only Parameters

Name Description
key_type
str

One of "primary", "secondary". Defaults to "primary".

Returns

Type Description

A poller to track the operation status.

Exceptions

Type Description

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

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

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

Raised if local path provided points to an empty directory.

Raised if local endpoint resource does not exist.

get

Get a Endpoint resource.

get(name: str, *, local: bool = False) -> OnlineEndpoint

Parameters

Name Description
name
Required
str

Name of the endpoint.

Keyword-Only Parameters

Name Description
local

Indicates whether to interact with endpoints in local Docker environment. Defaults to False.

Returns

Type Description

Endpoint object retrieved from the service.

Exceptions

Type Description

Raised if local endpoint resource does not exist.

get_keys

Get the auth credentials.

get_keys(name: str) -> EndpointAuthKeys | EndpointAuthToken

Parameters

Name Description
name
Required
str

The endpoint name

Keyword-Only Parameters

Name Description
local

Whether to interact with the endpoint in local Docker environment. Defaults to False.

Returns

Type Description

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

Exceptions

Type Description

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

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

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

Raised if local path provided points to an empty directory.

Raised if local endpoint resource does not exist.

invoke

Invokes the endpoint with the provided payload.

invoke(endpoint_name: str, *, request_file: str | None = None, deployment_name: str | None = None, input_data: str | Data | None = None, params_override: Any = None, local: bool = False, **kwargs: Any) -> str

Parameters

Name Description
endpoint_name
Required
str

The endpoint name

Keyword-Only Parameters

Name Description
request_file

File containing the request payload. This is only valid for online endpoint.

deployment_name

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.

input_data

To use a pre-registered data asset, pass str in format

local

Indicates whether to interact with endpoints in local Docker environment. Defaults to False.

Returns

Type Description
str

Prediction output for online endpoint.

Exceptions

Type Description

Raised if local endpoint resource does not exist.

Raised if there are multiple deployments and no deployment_name is specified.

Raised if local endpoint is None.

list

List endpoints of the workspace.

list(*, local: bool = False) -> ItemPaged[OnlineEndpoint]

Keyword-Only Parameters

Name Description
local

(Optional) Flag to indicate whether to interact with endpoints in local Docker environment. Default: False

Returns

Type Description

A list of endpoints

Exceptions

Type Description

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

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

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

Raised if local path provided points to an empty directory.

Raised if local endpoint resource does not exist.