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: azure.ai.ml._scope_dependent_operations.OperationScope, operation_config: azure.ai.ml._scope_dependent_operations.OperationConfig, service_client_02_2022_preview: azure.ai.ml._restclient.v2022_02_01_preview._azure_machine_learning_workspaces.AzureMachineLearningWorkspaces, all_operations: azure.ai.ml._scope_dependent_operations.OperationsContainer, local_endpoint_helper: azure.ai.ml.operations._local_endpoint_helper._LocalEndpointHelper, credentials: Optional[azure.core.credentials.TokenCredential] = None, **kwargs: Dict)

Parameters

operation_scope
operation_config
service_client_02_2022_preview
all_operations
local_endpoint_helper
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: azure.ai.ml.entities._endpoint.online_endpoint.OnlineEndpoint, *, local: bool = False) -> azure.core.polling._poller.LROPoller[azure.ai.ml.entities._endpoint.online_endpoint.OnlineEndpoint]

Parameters

endpoint
OnlineEndpoint
Required

The endpoint entity.

local
bool
Required

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

Returns

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

Return type

Exceptions

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, *, local: bool = False) -> azure.core.polling._poller.LROPoller[None]

Parameters

name
str
Required

Name of the endpoint.

local
bool
Required

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

Returns

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

Return type

Exceptions

Raised if local endpoint resource does not exist.

begin_regenerate_keys

Regenerate keys for endpoint.

begin_regenerate_keys(name: str, *, key_type: str = 'primary') -> azure.core.polling._poller.LROPoller[None]

Parameters

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

The endpoint name.

key_type
str
Required

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

Returns

A poller to track the operation status.

Return type

Exceptions

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) -> azure.ai.ml.entities._endpoint.online_endpoint.OnlineEndpoint

Parameters

name
str
Required

Name of the endpoint.

local
<xref:Optional>[bool]
Required

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

Returns

Endpoint object retrieved from the service.

Return type

Exceptions

Raised if local endpoint resource does not exist.

get_keys

Get the auth credentials.

get_keys(name: str) -> Union[azure.ai.ml._restclient.v2022_02_01_preview.models._models_py3.EndpointAuthKeys, azure.ai.ml._restclient.v2022_02_01_preview.models._models_py3.EndpointAuthToken]

Parameters

name
str
Required

The endpoint name

Returns

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

Return type

<xref:Union>[<xref:EndpointAuthKeys>, <xref:EndpointAuthToken>]

Exceptions

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, deployment_name: str = None, input_data: Union[str, azure.ai.ml.entities._assets._artifacts.data.Data] = None, params_override=None, local: bool = False, **kwargs) -> str

Parameters

endpoint_name
str
Required

The endpoint name

request_file
<xref:Optional>[str]
Required

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

deployment_name
<xref:Optional>[str]
Required

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
<xref:Optional>[<xref:Union>[str, Data]]
Required

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

local
<xref:Optional>[bool]
Required

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

Returns

Prediction output for online endpoint.

Return type

str

Exceptions

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) -> azure.core.paging.ItemPaged[azure.ai.ml.entities._endpoint.online_endpoint.OnlineEndpoint]

Parameters

local
bool
Required

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

Returns

A list of endpoints

Return type

Exceptions

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.