azure_ml_sdk.services.deployment.endpoint ========================================= .. py:module:: azure_ml_sdk.services.deployment.endpoint Classes ------- .. autoapisummary:: azure_ml_sdk.services.deployment.endpoint.OnlineDeployment azure_ml_sdk.services.deployment.endpoint.OnlineEndpoint azure_ml_sdk.services.deployment.endpoint.OnlineEndpointManager Module Contents --------------- .. py:class:: OnlineDeployment(ml_client: azure.ai.ml.MLClient, name: str, endpoint_name: str, config: Optional[dict] = {}) Class for defining deployments to be used in online endpoints. .. py:attribute:: ml_client .. py:attribute:: name .. py:attribute:: endpoint_name .. py:property:: status :type: Optional[str] Returns the provisioning state of an online deployment. .. py:property:: id :type: Optional[str] Returns the id of the online deployment. .. py:method:: get() -> Optional[azure.ai.ml.entities.ManagedOnlineDeployment] Return the online deployment object. :raises ValueError: If the online deployment is not found in the online endpoint. :returns: The online deployment object. :rtype: Optional[ManagedOnlineDeployment] .. py:method:: get_logs(lines: int = 100) -> str Retrieve the logs from the online deployment. :param lines: The maximum number of lines to tail. Defaults to 100 lines. :type lines: int :returns: the logs of the online deployment. :rtype: str .. py:method:: set(model: Optional[str] = None, environment: Optional[str] = None, scoring_folder: Optional[str] = None, scoring_script: Optional[str] = None, instance_type: Optional[str] = 'STANDARD_E4S_V3', instance_count: Optional[int] = 1) -> None Configure the online deployment. :param model: The name of the registered model in the workspace. :type model: str :param environment: The name of the registered environment in the workspace. :type environment: str :param scoring_folder: The path to the folder containing the scoring script. :type scoring_folder: str :param scoring_script: The name of the scroring script (.py). :type scoring_script: str :param instance_type: The name name of the compute instance. :type instance_type: str :param instance_count: The number of instances to deploy. Defaults to 1. :type instance_count: int .. py:class:: OnlineEndpoint(ml_client: azure.ai.ml.MLClient, name: str) Class for creating or updating online endpoints on Azure Machine Learning. .. py:attribute:: ml_client .. py:attribute:: name .. py:property:: status :type: Optional[str] Return the provisioning state of the online endpoint. .. py:property:: scoring_uri :type: Optional[str] Return the scoring uri of the online endpoint. .. py:property:: keys :type: Optional[str] Return the authentication key of the online endpoint. .. py:property:: id :type: Optional[str] Return the id of the online endpoint. .. py:method:: get() -> Optional[azure.ai.ml.entities.ManagedOnlineEndpoint] _summary_. :raises ResourceNotFoundError: _description_ :returns: _description_ :rtype: Optional[ManagedOnlineEndpoint] .. py:method:: invoke(deployment_name: str, request_file: str) -> None Invoke the online endpoint with a payload in a json request file. :param deployment_name: The name of the online deployment to invoke. :type deployment_name: str :param request_file: The path to a json file containing the request. :type request_file: str .. py:method:: list_deployments() -> List[str] List all deployments of the online endpoint. :returns: List of the names of the deployments of the online endpoint. :rtype: List[str] .. py:method:: get_deployment(deployment_name: str) -> Optional[OnlineDeployment] Get a deployment of the online endpoint. :raises ValueError: If the deployment is not found in the online endpoint. :param deployment_name: The name of the deployment. :type deployment_name: str :returns: The online deployment, if it exists. :rtype: Optional[OnlineDeployment] .. py:method:: create_or_update_deployment(deployment_name: str, config: Optional[dict] = {}) -> OnlineDeployment Create a deployment in the online Endpoint. :param deployment_name: The name of the deployment to create or update. :type deployment_name: str :param config: The dictionary containing the deployment configuration. :type config: dict :raises ResourceNotFoundError: if the endpoint is not found in the workspace. .. py:method:: delete_deployment(deployment_name: str) -> None Delete a deployment from an online endpoint. :param deployment_name: The name of the deployment. :type deployment_name: str :raises ValueError: If the deployment is not found in the online endpoint. .. py:class:: OnlineEndpointManager(ml_client: azure.ai.ml.MLClient) Class for managing online endpoints on Azure Machine Learning. .. py:attribute:: ml_client .. py:method:: list_endpoints() -> List[str] List all online endpoints in the workspace. :returns: A list of the names of the endpoints of the workspace. .. py:method:: create_endpoint(endpoint_name: str, description: str, auth_mode: str = 'key') -> OnlineEndpoint Create an online endpoint in the workspace. :param endpoint_name: name of the endpoint. :type endpoint_name: str :param description: description of the endpoint. :type description: str :param auth_mode: Authentication mode. Possible values: 'aml_token', 'key'. Defaults to 'key'. :type auth_mode: str .. py:method:: delete_endpoint(endpoint_name: str) -> None Delete an online endpoint in the workspace. :param endpoint_name: name of the endpoint. :type endpoint_name: str .. py:method:: get_endpoint(endpoint_name: str) -> OnlineEndpoint Get an online endpoint (if deployed). :returns: The online endpoint instance. :rtype: OnlineEndpoint